<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var names = ["iwen", "frank", "ime"];  //删除了头部元素
        names.shift();       
        console.log(names);
        var result = names.shift();


        var arr = [];
        console.log(arr.shift());

        var arr1 = [100, 200, 300];
        var item;
        while (item = arr1.shift()) {
            console.log(item);
        }
        console.log(arr1);


        var arr2=[200];
        arr2.unshift(100,300,120);   //unshift在头部添加元素
        console.log(arr2);
    </script>
</body>

</html>